package com.firewolf.fr.servlet;

import java.io.IOException;
import java.util.Arrays;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name = "index2", urlPatterns = "/index2")
public class IndexServlet2 extends HttpServlet {

	private static final long serialVersionUID = 928855988388039713L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//这里面和之前一样只是设置数据就可以了
		req.setAttribute("user", "freemark");
		req.setAttribute("users", Arrays.asList("张飞", "关羽", "刘备"));
		req.getRequestDispatcher("index.ftl").forward(req, resp);
//		req.getRequestDispatcher("erro.jsp").forward(req, resp);
	}
}
